package org.yxk;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;

public class Test1 {
	int n;
	
	public static void main(String[] args)  {
		System.out.println(new Test1().n);
		String a="AAAssss";
				String b="AAAssss";
		System.out.println(a.hashCode());
		System.out.println(b.hashCode());
//		int arr[]= {6,7,1,56,22,11,88,35,2,5};
//		int a[]=new Test1().sort2(arr);
//		System.out.println(Arrays.toString(a));

	}
	/**
	 * 归并排序
	 * @param arr
	 * @return
	 */
	public int[] sort3(int [] arr) {
		
		return arr;
		
	}
	public void merge(int[] arr) {
		int mid=arr.length/2;
		int [] temp= new int[arr.length];
	}
	/**
	 * 希尔排序
	 * @param sourceArray
	 * @return
	 */
	    public int[] sort2(int[] sourceArray) {
	        // 对 arr 进行拷贝，不改变参数内容
	        int[] arr = Arrays.copyOf(sourceArray, sourceArray.length);

	        int gap = 1;
	        while (gap < arr.length) {
	            gap = gap * 3 + 1;
	        }

	        while (gap > 0) {
	            for (int i = gap; i < arr.length; i++) {
	                int tmp = arr[i];
	                int j = i - gap;
	                while (j >= 0 && arr[j] > tmp) {
	                    arr[j + gap] = arr[j];
	                    j -= gap;
	                }
	                arr[j + gap] = tmp;
	            }
	            gap = (int) Math.floor(gap / 3);
	        }

	        return arr;
	    }
	/**
	 * 插入排序
	 * @param sourceArray
	 * @return
	 */
	 public int[] sort(int[] sourceArray)  {
		 int [] arr =Arrays.copyOf(sourceArray, sourceArray.length);
		 for (int i = 1; i < arr.length; i++) {
			 int t = arr[i];
			 int j=i;
			 while(j>0&&t<arr[j-1]) {
				 arr[j]=arr[j-1];
				 j--;
			 }
			if(j!=i) {
				arr[j]=t;
			}
		}
		return arr;
		 
	 }
	 
}
class A{
	int a;
	int b;
	
	public A(int a, int b) {
		super();
		this.a = a;
		this.b = b;
	}
	public int getA() {
		return a;
	}
	public void setA(int a) {
		this.a = a;
	}
	public int getB() {
		return b;
	}
	public void setB(int b) {
		this.b = b;
	}
	
}